UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QFSDfW16owE7Hmfd+4Oh+BO3AacCr50PVJACVfe/OnA='
WHERE
key_id = '3025676307b0d3344ad64eaf0e849655aeb76c77e095c39c2856d00b529b0a8e'
AND (
token = 'QFSDfW16owE7Hmfd+4Oh+BO3AacCr50PVJACVfe/OnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)