UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7R+n1xKDRWWAv5wajM2pYpqRz+gZM2ZlbH3Q6eonZ2w=' 
WHERE 
  key_id = '2d44b3fd4b0e4c1234a6d40a7bd8aa90d9c2d4187adc7095743fc1d72514aecc' 
  AND (
    token = '7R+n1xKDRWWAv5wajM2pYpqRz+gZM2ZlbH3Q6eonZ2w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037