UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd3KME8C41a2txOAvQbjJzSCr6/7ZiSfrIoLQH/Djvr0='
WHERE
key_id = '8b5cc92d5aec417d4c8f177e0e574de684461cb622a548bdae3ff3ff9bb2bf15'
AND (
token = 'd3KME8C41a2txOAvQbjJzSCr6/7ZiSfrIoLQH/Djvr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)