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