UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jIbcW5E3AFaReYJv7/vWJeUK0Art5oVspjpf6Sp2t54=' 
WHERE 
  key_id = '1b495935ff8c5c38a9c576c1b9fd1f83cdfef43b7fd41ea3c024fd90f2b731e6' 
  AND (
    token = 'jIbcW5E3AFaReYJv7/vWJeUK0Art5oVspjpf6Sp2t54=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041