UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A1jMgfm2aQ5iY1mVb+i3WCWNcncVyyiUpmluvaqNqFo=' 
WHERE 
  key_id = '0734b813d81436089087f8194dbdb33db154e430400b00c6bdc9a27664f1109f' 
  AND (
    token = 'A1jMgfm2aQ5iY1mVb+i3WCWNcncVyyiUpmluvaqNqFo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033