UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P2IXvv5MLJXzcBC7zQki2FvJc/S0SpZdmwctIstZt24='
WHERE
key_id = 'add3965884053de53a51a0c72be93ce77d0db8b63034be706c1f10fd91056317'
AND (
token = 'P2IXvv5MLJXzcBC7zQki2FvJc/S0SpZdmwctIstZt24='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)