UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'phxhO2mazqkcNeoTpVyI0aUl/mnQtTyzss2kQohklO0='
WHERE
key_id = 'ee5ea262e6da42ec01a82ae21ccbad41284736fc25a33149d44510e5df733e1b'
AND (
token = 'phxhO2mazqkcNeoTpVyI0aUl/mnQtTyzss2kQohklO0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)