UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qs3302m569q5LKU5uryCCNeaRQekNOEWmvOMCHJN2rI=' 
WHERE 
  key_id = '08fdfe82a313e2f6e57ae175289372de3710686973c649f7286545f07dd6c0f1' 
  AND (
    token = 'Qs3302m569q5LKU5uryCCNeaRQekNOEWmvOMCHJN2rI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041