UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oSWd/tuSMqf9vipHrKGxZSipEaGhGblAQaRR3SgopHY=' 
WHERE 
  key_id = '00f520ec9e6752fbfb4597bcb33e9536b8810596449377f1d8758fc19335f719' 
  AND (
    token = 'oSWd/tuSMqf9vipHrKGxZSipEaGhGblAQaRR3SgopHY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00092