UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pDqanDIEGIJPJmHkPlPkfl1Q3R+hD5QmvNlWeIrTOX4='
WHERE
key_id = 'a97402730bc1470b0034ce9d2b666386e7faaf9cdca7e6886871eaf86faade2f'
AND (
token = 'pDqanDIEGIJPJmHkPlPkfl1Q3R+hD5QmvNlWeIrTOX4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)