UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/YwzkpsuN0UY6Gnsxvah3rWZ1bQY3/l3B3s/jqIYj7Q=' 
WHERE 
  key_id = 'b8bc5361f336d5c388531bb105a5b3b3fc6c5255bb0677ebbe4fb195243d7ce5' 
  AND (
    token = '/YwzkpsuN0UY6Gnsxvah3rWZ1bQY3/l3B3s/jqIYj7Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038