UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E/Ay4Rfs9f8Fdf/YAzKocKtKTaNhlrblbeoqOvFH6Jk='
WHERE
key_id = '3c339acc46a8d994d52f9df75b5be13ef554fb3a50999188163fd78d0ebff526'
AND (
token = 'E/Ay4Rfs9f8Fdf/YAzKocKtKTaNhlrblbeoqOvFH6Jk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)