UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Cfrje4pi6cE7PIHpRdRMZ5/KbdyZSfjOQZg9TkWeVc='
WHERE
key_id = '51cff590d501d156653716a36b55c71fa1225c3f278ddf850683d75bd9152a2b'
AND (
token = '4Cfrje4pi6cE7PIHpRdRMZ5/KbdyZSfjOQZg9TkWeVc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)