UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm+sfAj5uPnVLJhD9bxg/JxqS+ACy0hJrU7a9rZ/ViNo=' 
WHERE 
  key_id = 'bdb8b866550036d7268e57cd83f6fa1ff5598a77c24259116d4dbce72465f6a5' 
  AND (
    token = 'm+sfAj5uPnVLJhD9bxg/JxqS+ACy0hJrU7a9rZ/ViNo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021