UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rQlgX+kL+7M9dhfqcgNDAshXhV0p+2pMVu5IhSNDrVQ=' 
WHERE 
  key_id = 'a3cbf674e69a2fc937135e74988113046c2ef02b2e4f7915fbf8c27e9208cbed' 
  AND (
    token = 'rQlgX+kL+7M9dhfqcgNDAshXhV0p+2pMVu5IhSNDrVQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028