UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O7WUDvKYQEpqQ1wQaKh97vZQzDeUDYkF3fg3jpm6/Sg='
WHERE
key_id = '45e524935eff2b797ca14a0616b390b5a6dfec40262836db31d4890311166665'
AND (
token = 'O7WUDvKYQEpqQ1wQaKh97vZQzDeUDYkF3fg3jpm6/Sg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)