UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w4A4eiMfov4AMa7H92B63I8rlB1s32MPmJJJvdXC/zg=' 
WHERE 
  key_id = '0f94ccef0d43d54777921eba3d63b927727db1010fd158bd1f9a46e590b66223' 
  AND (
    token = 'w4A4eiMfov4AMa7H92B63I8rlB1s32MPmJJJvdXC/zg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030