UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AEKW5HaK5It+8/61wUb20HXOUEt+0nGC32UXClCKGFY='
WHERE
key_id = 'a90876942c56d1486937d459b2bb03548ec1f3d5611ff4a164d718228d03f5dd'
AND (
token = 'AEKW5HaK5It+8/61wUb20HXOUEt+0nGC32UXClCKGFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)