UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IjUyuQq/rrh4e22KmYyLs0NSjZy66IHeL/OhUvSe9a4=' 
WHERE 
  key_id = '8b53e27df66596ea4d17e8fd5bbc8e7d059628c4d6cad9e1ec2b1ec082151eef' 
  AND (
    token = 'IjUyuQq/rrh4e22KmYyLs0NSjZy66IHeL/OhUvSe9a4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037