UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sMRKXToZbFJF9fzJEkRK/heLdOwBT19mRr0f1NFpmdw=' 
WHERE 
  key_id = '44d954ffcc79c72b5cba7487f2d60cb37866273de72bce07ac261b64f6e6f522' 
  AND (
    token = 'sMRKXToZbFJF9fzJEkRK/heLdOwBT19mRr0f1NFpmdw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038