UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tYVwy1rOfiE4Pasor54U8fP1mQCkP92ck4+d7Hsk29M='
WHERE
key_id = '4e754ea58e73e1f39c5a72308786a00550802a4dc63ddd02b2ef716d7d731ba4'
AND (
token = 'tYVwy1rOfiE4Pasor54U8fP1mQCkP92ck4+d7Hsk29M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)