UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ab8vDDkzKFaSsmSRhsxkbrTS4EfVD+eLYWUcl2z4+0k=' 
WHERE 
  key_id = '0c61f8441405072fd0e4913d3e0765d2c159add63c0a6659fe1f4f33c34b8386' 
  AND (
    token = 'ab8vDDkzKFaSsmSRhsxkbrTS4EfVD+eLYWUcl2z4+0k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037