UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wD1+AD7Rt23m9Oi1SS8wXkEPJTz2zgeht0lJbNYRU1Q=' 
WHERE 
  key_id = '1e7528bf90ceb6d77d3020d560b981c7af7624feb002ab8ccd7bdd8f5134e4c9' 
  AND (
    token = 'wD1+AD7Rt23m9Oi1SS8wXkEPJTz2zgeht0lJbNYRU1Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042