UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+F1HsHHbZT/cBG8oKT22H/MkTPN81VB+cWR/xyUkWCs='
WHERE
key_id = '583ced684b9425c5a1069078204375a84d3309473c506edce3245df9a547303b'
AND (
token = '+F1HsHHbZT/cBG8oKT22H/MkTPN81VB+cWR/xyUkWCs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)