UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Syn41SmvP7cF54+BbNrOAD/3q7T8MZIUlHAEmLRLtv4=' 
WHERE 
  key_id = 'f22d44506466a202407b6b2728e240d8af7907567623fc412627ba0bef0818e7' 
  AND (
    token = 'Syn41SmvP7cF54+BbNrOAD/3q7T8MZIUlHAEmLRLtv4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031