UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5zE30l5919gdTyRS0Tf9D5cmu5uQGmSCXiJtR2v5WFk='
WHERE
key_id = '4ca537049ca21d8c42c9cc451b38f53b1e5da13426bce3be8775c9d2159e92eb'
AND (
token = '5zE30l5919gdTyRS0Tf9D5cmu5uQGmSCXiJtR2v5WFk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)