UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'peIr7gUOlEYIXVW/vf3LgHSAByTImSD4Vtojh/bt0Jo='
WHERE
key_id = 'b66e0d642ecb91cdfe251b7698a01196cba18b139b7c71303b5cb0c40afbde9b'
AND (
token = 'peIr7gUOlEYIXVW/vf3LgHSAByTImSD4Vtojh/bt0Jo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)