UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IJYWt6CSiTiw1DOytQliWfAVLEuOgxIRb1GDK9y4h5I='
WHERE
key_id = '65b158cfeab22e27b5703fb6d606d14cc22f2e86c2a85d5f597b256ef840c363'
AND (
token = 'IJYWt6CSiTiw1DOytQliWfAVLEuOgxIRb1GDK9y4h5I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)