UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z6Y0shDJAZVpzXx3+4TQ49GU9Pf45RqllWkKn1yi41s=' 
WHERE 
  key_id = '2ad73a550a409e404ff05a6d28d9496da345050d1c6526247600d8352f4a1355' 
  AND (
    token = 'Z6Y0shDJAZVpzXx3+4TQ49GU9Pf45RqllWkKn1yi41s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031