UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l9a6lCas4OK3leoGuR/nICJsi+wI/VovzT38xnw9igw='
WHERE
key_id = '7fe1f78412940079f49aeb8a70480b7b252378b8925b583de30618811c480ff9'
AND (
token = 'l9a6lCas4OK3leoGuR/nICJsi+wI/VovzT38xnw9igw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)