UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bKBiLn/lT5wkAG6lZv80LUN2TAt2vqnKv1j4QJBeJEQ='
WHERE
key_id = '1ef0146845221f0e4407d3bf4a363b9cf78c59130f9ae507100fa61309de51d7'
AND (
token = 'bKBiLn/lT5wkAG6lZv80LUN2TAt2vqnKv1j4QJBeJEQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)