UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ngbBlJbKA4KQmLR6EWz9iXLG9NsqJKIWkKiPh9oxB2U='
WHERE
key_id = 'ef513c9edee4528267117442604802597c830909a8ee82be1a2a35668a28b010'
AND (
token = 'ngbBlJbKA4KQmLR6EWz9iXLG9NsqJKIWkKiPh9oxB2U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)