UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dn7bHt1N+unY3OwBx4+jxH//iKDu+wc2w39O08Hbluc=' 
WHERE 
  key_id = 'f3cd0dbe5126f12c07f0a7dac3ab5e29bb38b0494a297db54508afc9ed941aa3' 
  AND (
    token = 'dn7bHt1N+unY3OwBx4+jxH//iKDu+wc2w39O08Hbluc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039