UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hLcyik5Sf4Ogo/63O6PiECL+q2v1wLMsm91VB5Qyc70='
WHERE
key_id = '0278280a621120c6d53bb768f2c40a73581ee0e35a5615eb41c5678ca7919566'
AND (
token = 'hLcyik5Sf4Ogo/63O6PiECL+q2v1wLMsm91VB5Qyc70='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)