UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mA1hd5rxTRpAJ2lQBwmV38bYdmymDVl1SVIalZ/XCE8='
WHERE
key_id = 'aba3688a4c2622b3d30851b7b08b9f5dbd0f24c6a25eab707b6390df9c7a75c9'
AND (
token = 'mA1hd5rxTRpAJ2lQBwmV38bYdmymDVl1SVIalZ/XCE8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)