UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '00xeMcdswZlZMUPnWU9BVux82H3RfQUshRu6a5DU2Ik=' 
WHERE 
  key_id = 'e42b7c1ed63fcab26361a1e9303395488f3ee50cde6193532c0e61473952741e' 
  AND (
    token = '00xeMcdswZlZMUPnWU9BVux82H3RfQUshRu6a5DU2Ik=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056