UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9z4nUJILguL/+uASE3P7AWo5RBIwyCJ9oE0/UPPTnmM=' 
WHERE 
  key_id = '66a734da19185f4f9504fad37e3a9ae6752c6c8b8cb3a695141702c150cabde8' 
  AND (
    token = '9z4nUJILguL/+uASE3P7AWo5RBIwyCJ9oE0/UPPTnmM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034