UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7HF5QUX7bJ9kpR26uo9YKRpuIfx+S1S+MbPr2TGByXI='
WHERE
key_id = '09bba9fb1fd238e9feec4e32b6be75ea2f3507338132ae00cf8c91f67ed02003'
AND (
token = '7HF5QUX7bJ9kpR26uo9YKRpuIfx+S1S+MbPr2TGByXI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)