UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+9IwZGHPDIuMUCZk8UnFJHhL/iBLgrHHoG7TcZoXhLA='
WHERE
key_id = '846648122b47f46fb130ade85a8f24a960fd72ccab809894b00a123043f855c8'
AND (
token = '+9IwZGHPDIuMUCZk8UnFJHhL/iBLgrHHoG7TcZoXhLA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)