UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6GP0bQIc3u7QrkRZFNbUadJUIq0BEjYl2bf4V0bhS/Q='
WHERE
key_id = '9acd9e7e60c4aa274799e3492ff64661f0a3f2bb2462a65d81c15d2394dcd4b4'
AND (
token = '6GP0bQIc3u7QrkRZFNbUadJUIq0BEjYl2bf4V0bhS/Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)